package com.manor.main.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.manor.common.bean.UserNBean;
import com.manor.main.R;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * @version 1.0
  
 * @date 2020/6/18  14:06
 */
public class JzAdapter extends BaseQuickAdapter<UserNBean.MedalBean, BaseViewHolder> {

    public JzAdapter(int layoutResId, @Nullable List<UserNBean.MedalBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, UserNBean.MedalBean item) {
        //iv_jz_img
        String url = item.getStatus() == 1 ? item.getIcon() : item.getIcon_out();

        Glide.with(getContext())
                .load(url)
                .centerCrop()
                .into((ImageView) helper.getView(R.id.iv_jz_img));
//            helper.getView(R.id.iv_jz_img).setOnClickListener(v -> {
//                if (StringUtil.isNotEmpty(item.getDetail()))
//                    new XPopup.Builder(mContext)
//                            .atView(v)
//                            .hasShadowBg(false)
//                            .asCustom(new CustomAttachPopup(mContext, item.getDetail()))
//                            .show();
//            });
    }


}
